<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <style>
    .outerDiv {
      width: 160px;
      height: 400px;
      background-color: pink;
      font-size: 10px;
      line-height: 10px;
    }
    .upperDiv {
      width: 50px;
      height: 50px;
      background-color: red;
    }
    .downDiv {
      width: 50px;
      height: 50px;
      background-color: green;
    }
    #targetDiv {
      /* 正常情况下，margin也会撑大盒子 */
      margin-bottom: 50px;
      /* 设置溢出隐藏后，溢出到border上的内容都会被隐藏，更何况溢出到margin上的内容 */
      overflow: hidden;
    }
    </style>
    <link href="css/style.css" rel="stylesheet">
  </head>
  <body>
    <div class="outerDiv">
      <div class="upperDiv" id="targetDiv">
        aa<br>
        ba<br>
        ca<br>
        da<br>
        ea<br>
        aa<br>
        ba<br>
        ca<br>
        da<br>
        ea<br>
        aa<br>
        ba<br>
        ca<br>
        da<br>
        ea<br>
        aa<br>
        ba<br>
        ca<br>
        da<br>
        ea<br>
      </div>
      <div class="downDiv"></div>
    </div>
  
  </body>
</html>
